<?

error_reporting(1);

require_once "core.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.newsletter.php";


$newsletter = new newsletter;
$values = $newsletter->get_all();
$values = $values[0];
$lf = chr(10);
$cr = chr(13);

foreach($values as $value){

	$string .= $value['email'].$cr.$lf;

}
	
$file = "/www/latedeals/tasks/latedeals_newsletter_emails.txt";
$fh = fopen($file, 'w') or die("can't open file");
fwrite($fh, $string);
fclose($fh);
	

?>